package com.newthread.jdp.service.impl;

import java.io.IOException;
import java.util.List;

import javax.annotation.Resource;

import org.apache.http.client.ClientProtocolException;
import org.springframework.stereotype.Service;
import com.newthread.jdp.dao.UserInfoDAO;
import com.newthread.jdp.model.UserInfo;
import com.newthread.jdp.service.UserService;

@Service
public class UserServiceImpl implements UserService {
	private UserInfoDAO userDAO;


	@Resource
	public void setUserDAO(UserInfoDAO userDAO) {
		this.userDAO = userDAO;
	}

	public void add(UserInfo userInfo) {
		userDAO.add(userInfo);
	}

	@Override
	public UserInfo getUserInfoFormShcoolWeb(String studentId, String passWord) throws ClientProtocolException, IOException {
		return userDAO.getUserInfoFormShcoolWeb(studentId, passWord);
	}

	@Override
	public List<UserInfo> querry(UserInfo userInfo) {
		return userDAO.querry(userInfo);
	}

	@Override
	public void update(UserInfo userInfo) {
		userDAO.update(userInfo);
	}

	@Override
	public List<UserInfo> querryAll() {
		return userDAO.querryAll();
	}

	@Override
	public UserInfo getUser(UserInfo userInfo) {
		return userDAO.getUser( userInfo);
	}

}
